@extends('home.parent')
@section('title','新增会员')
@section('head_js')
@endsection
@section('head_css')
<link rel="stylesheet" href="{{ asset('/css/select2/select2.min.css') }}">
<link rel="stylesheet" href="{{ asset('/css/datepicker3.css') }}">
@endsection
@section('content')
<div class="content-wrapper">
<section class="content-header">
	<h1>
		新增会员
		<small></small>
	</h1>
	<ol class="breadcrumb">
		<li><a href="{{URL('admin')}}"><i class="fa fa-dashboard"></i> 首页</a></li>
		<li><a href="{{URL('admin/vip/list')}}">会员列表</a></li>
		<li class="active">新增会员</li>
	</ol>
</section>
<style>
	form div input[type="password"],form div input[type="text"],select[name="industry_id"],select[name="customertype"],select[name="pay_type"],select[name="pList_id"]{width:280px;color:#717171;}
	form div input[type="password"],form div input[type="text"],select[name="industry_id"],select[name="gender"],select[name="pay_type"],select[name="pList_id"]{width:280px;color:#717171;}
	form div label{padding: 7px 15px 0 0;text-align:right;color:#717171;}
	form div button{margin-right:10px;}
	form div.ca_number{display:none;}
	form div.box-body label{width:100px;}
	form div input.form-control,form div select.form-control{display:inline;}
	form div ul li{list-style-type:none;float:left;padding:5px 0;width:100%;}
	form div ul li>div{width:150px;float:left;border:2px solid transparent;margin-left:10px;border-radius:8px;cursor:pointer;background:#009688;color:#fff;}
	form div ul li>div span{display:block;padding:3px 8px;text-align:center;}
	form div ul li>div span b{color:yellow;}
	form div ul li div span.yes{display:none;padding:0;}
	form div ul li div.active{border:2px solid #f38d24;}
	form div ul li div.active span.yes{display:block;}
	form div ul li>div span label{background:#009688;color:yellow;display:inline-block;text-align:center;padding:0 5px;}
	form div ul li>div span i{cursor:pointer;}
	form div ul li>div span i:hover{color:#f38d24;}
	#data_form span.fa{top:10px;left:390px;margin-left:-18px;position:absolute;cursor:pointer;color:#009688;}
	@media screen and (max-width: 465px) {
		#data_form span.fa{top:41px;left:290px;margin-left:-18px;position:absolute;cursor:pointer;color:#009688;}
	}
</style>
<section class="content">
	<div class="row">
		<div class="col-md-12">
			<!--general form elements-->
			<div class="box box-primary">
				<form id="data_form">
					<div class="box-body">
						<div class="form-group col-lg-6 col-md-12">
							<label class="control-label">登录用户名
								<span style="color: red">*</span>
							</label>
							<input type="text" class="form-control" name="user_name" autocomplete="off" placeholder="5-11位 字母、数字、下划线" maxlength="11">
						</div>
						<div class="form-group col-lg-6 col-md-12">
							<span class="fa fa-eye showPwd"></span>
							<label class="control-label">登录密码
								<span style="color: red">*</span>
							</label>
							<input type="password" class="form-control" name="pwd" autocomplete="off"	placeholder="6-16位 字母、数字、下划线" maxlength="16">
						</div>
						<div class="form-group col-lg-6 col-md-12">
							<label class="control-label">类型<span style="color: red">*</span></label>
							<select class="form-control" name="customertype">
								<option value="1">--请选择--</option>
								<option value="1">公司</option>
								<option value="2">个体户</option>
							</select>
						</div>

						<div class="form-group col-lg-6 col-md-12">
							<label class="control-label">所在地
								<span style="color: red">*</span>
							</label>
							<input type="text" class="form-control" name="city" placeholder="请输入所在地" maxlength="20">
						</div>
						<div class="form-group col-lg-6 col-md-12">
							<label class="control-label">公司名字
								<span style="color: red">*</span>
							</label>
							<input type="text" class="form-control" name="company" placeholder="请输入会员机构" maxlength="20">
						</div>
						<div class="form-group col-lg-6 col-md-12">
							<label class="control-label">具体地址
								<span style="color: red">*</span>
							</label>
							<input type="text" class="form-control" name="address" placeholder="请输入具体地址" maxlength="200">
						</div>
						<div class="form-group col-lg-6 col-md-12">
							<label class="control-label">行业
								<span style="color: red">*</span>
							</label>
							<select class="form-control" data-placeholder="请选择行业" name="industry_id">
								<option value="0">--请选择--</option>
								@if(!empty($industries))@foreach($industries as $industry)
								<option value="{{ $industry['id'] }}">
									{{$industry['name']}}
								</option>
								@endforeach @endif
							</select>
						</div>
						<div class="form-group col-lg-6 col-md-12">
							<label class="control-label">所属合伙人
								<span style="color: red">*</span>
							</label>
							<select class="form-control" data-placeholder="请选择所属合伙人" name="pList_id">
								<option value="0">--请选择--</option>
								@if(!empty($pList))@foreach($pList as $pList)
								<option value="{{ $pList['id'] }}">
									{{$pList['company']}}
								</option>
								@endforeach @endif
							</select>
						</div>
						<div class="form-group col-lg-6 col-md-12">
							<label class="control-label">联系人
								<span style="color: red">*</span>
							</label>
							<input type="text" class="form-control" name="name" placeholder="请输入会员联系人" maxlength="8">
						</div>
						<div class="form-group col-lg-6 col-md-12">
							<label class="control-label">手机号
								<span style="color: red">*</span>
							</label>
							<input type="text" class="form-control" name="mobile" placeholder="请输联系人手机号" maxlength="11">
						</div>
						<div class="form-group col-lg-6 col-md-12">
							<label class="control-label">性别</label>
							<select class="form-control" name="gender">
								<option value="0">--请选择--</option>
								<option value="1">男</option>
								<option value="2">女</option>
							</select>
						</div>
						<div class="form-group col-lg-6 col-md-12">
							<label class="control-label">微信</label>
							<input type="text" class="form-control" name="wechat" placeholder="请输入联系人微信号" maxlength="16">
						</div>
						<div class="form-group col-lg-6 col-md-12">
							<label class="control-label">邮箱</label>
							<input type="text" class="form-control" name="email" placeholder="请输入联系人邮箱" maxlength="100">
						</div>
						<div class="form-group col-lg-6 col-md-12">
							<label class="control-label">备注</label>
							<input type="text" class="form-control" name="remark" placeholder="备注">
						</div>
					</div>
					<div class="box-body">
						<label class="col-sm-2 control-label">套餐选择
							<span style="color: red;">*</span>
						</label>
						<ul class="col-md-10">
							<input type="hidden" name="taocan" >
							<li class="xunpan">
								<?
								if(is_array($inquiry)){
									foreach($inquiry as $k=>$v){?>
										<div class="{{$k}}" onclick="selectedXunpan(this,'xunpan','{{$k}}')">
											<span class="yes"><img src="/images/iq_yes.png"></span>
											<span><h4>{{isset($v['iqname']) ? $v['iqname'] : ''}}</h4></span>
											<span><b>{{isset($v['iqprice']) ? $v['iqprice'] : 0}}</b> 元 / 一年</span>
											<span>视频上传 <b>{{isset($v['iqkeymber']) ? $v['iqkeymber'] : 0}}</b> 个</span>
											<span>询盘次数 <b>{{isset($v['iqnumber']) ? $v['iqnumber'] : 0}}</b> 次</span>
											<span>视频雷达数 <b>{{isset($v['iqmonumber']) ? $v['iqmonumber'] : 0}}</b> 个</span>
											<span>账户雷达数 <b>{{isset($v['iqtopnumber']) ? $v['iqtopnumber'] : 0}}</b> 个</span>
										</div>
									<?}
								}
								?>
							</li>
							<li class="taocan">
								
							</li>
						</ul>
					</div>
					<!--/.box-body-->
					<div class="box-footer">
						<label class="col-sm-1 control-label"></label>
						<button type="button" class="btn btn-info data_form">提 交</button>
						<button type="reset" class="btn btn-default">重 置</button>
						<button type="button" class="btn btn-default" onclick="history.go(-1)">取 消</button>
					</div>
				</form>
			</div>
		</div>
	</div>
</section>
</div>
@endsection
@section('foot_js')
<script src="{{ asset('/js/apk.js') }}"></script>
<script src="{{ asset('/js/tools.js') }}"></script>
<script>
$('select[name="pay_type"]').change(function(){
	if($(this).val()==4){
		$('#data_form div.ca_number').show();
	}else{
		$('#data_form div.ca_number').hide();
	}
});
$('#data_form button.data_form').click(function(){
	// puppet.mesWarn('开户金额有误！请输入大于0的值');
	var data=$('#data_form').serialize();
	var url = "{{URL('admin/vip/create/save')}}";
	var result = puppet.myajax('post',url,data,false);
	if(result.code == 1){
		layer.msg(result.msg,{icon:2});
		return false;
	}else{

		layer.msg(result.msg,{icon:1});
		setInterval(function(){
			window.location.href=result.url;
		},"2000");
	}
});
$('form div ul li>div').hover(function(){
	$(this).css({"border":"2px solid #f38d24"});
},function(){
	if(!$(this).hasClass('active')){
		$(this).css({"border":"2px solid transparent"});
	}
});
function selectedXunpan(obj,li_class_name,div_class_name){
	if(!$(obj).hasClass('active')){
		$('li.'+li_class_name+' div').removeClass('active').css({"border":"2px solid transparent"});
		$('li.'+li_class_name+' div.'+div_class_name).addClass('active').css({"border":"2px solid #f38d24"});
		$('input[name="taocan"]').val(div_class_name);
	}
}
//查看密码
$('.showPwd').hover(function(){
	$(this).removeClass('fa-eye');
	$(this).addClass('fa-eye-slash');
	$(this).parent().children('input').attr('type','text');
},function(){
	$(this).removeClass('fa-eye-slash');
	$(this).addClass('fa-eye');
	$(this).parent().children('input').attr('type','password');
});
</script>
@endsection